package main.java.io;

import scala.util.control.Exception;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

public class io4 {
    public static void main(String[] args) throws IOException {
        SocketChannel sc = SocketChannel.open(new InetSocketAddress("www.baidu.com",80));

        sc.configureBlocking(false);
        ByteBuffer bf = ByteBuffer.allocate(100);
        sc.read(bf);
        sc.close();
        System.out.println("over");


    }
}
